<template>
  <div class="home-con">
    <!-- <mt-swipe :auto="4000">
      <mt-swipe-item>1</mt-swipe-item>
      <mt-swipe-item>2</mt-swipe-item>
      <mt-swipe-item>3</mt-swipe-item>
    </mt-swipe>-->
    <mt-swipe :auto="4000">
      <mt-swipe-item v-for="item in lunbotu" :key="item.id">
        <img
          :src="item.img"
          onerror="this.src='http://www.itcast.cn/subject/webzly/images/1.jpg';this.onerror=null"
        />
      </mt-swipe-item>
    </mt-swipe>
  </div>
</template>
<script>
export default {
  data() {
    return {
      lunbotu: []
    };
  },
  created() {
    this.getLunbotu();
  },
  methods: {
    async getLunbotu() {
      const { data } = await this.$http.get("/api/getlunbo");
      console.log(data);
      if (data.status === 0) this.lunbotu = data.message;
    }
  }
};
</script>
<style lang='scss' scoped>
.mint-swipe {
  height: 180px;
  .mint-swipe-item {
    img {
      width: 100%;
      height: 100%;
    }
    &:nth-child(1) {
      background-color: red;
    }
    &:nth-child(2) {
      background-color: blue;
    }
    &:nth-child(3) {
      background-color: palegreen;
    }
  }
}


</style>